package com.etboot;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * @author Exrickx
 */
@SpringBootApplication
//启用JPA审计
@EnableJpaAuditing
//启用缓存
@EnableCaching
//启用异步
@EnableAsync
//启用自带定时任务
@EnableScheduling
// 启用Admin监控
// @EnableAdminServer
@EnableAutoConfiguration(exclude = {
        // org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration.class,
        org.activiti.spring.boot.SecurityAutoConfiguration.class
})
public class ETBootApp {
    public static void main(String[] args) {
        SpringApplication.run(ETBootApp.class, args);

        // fix bug: 修复加了 @Cacheable 注解的方法，无法被 AOP 日志切面识别的问题
        // ConfigurableApplicationContext appCtx = SpringApplication.run(ETBootApp.class, args);
        // SpringContextUtil springContextUtil = new SpringContextUtil();
        // springContextUtil.setApplicationContext(appCtx);
    }
}
